<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/13
 * Time: 17:18
 */
function sqlQuery($sql){
    //1.创建数据库的链接对象
    $conn=new mysqli("localhost","root","","mysq","3306");
//2.设置链接字符集
    mysqli_query($conn,"set names utf8");
//3.准备sql语句

//4.执行sql语句
    $dataResult=$conn->query($sql);
//5.关闭数据库链接
    $conn->close();
    //返回结果
    return $dataResult;
}